﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ZLDC.Common.Estate;
using ZLDC.Topo.Model.Estate;
using ZLDC.Topo.BLL.Estate;

namespace ZLDC.Estate
{
                public class CacheCustomer
    {
        #region 客源详情

                                                public static string Cache_Detail_Json(int id)
        {
            string json = "";
            string cachekey = CacheConst.CACHE_CUSTOMER_DETAIL_JSON + id.ToString();

            if (_Cache.GetCache(cachekey) == null || _Cache.GetCache(cachekey).ToString() == "")
            {
                json = ZLDC.Topo.BLL.Estate.CustomerBLL.p_customer_detail_table(id);
                _Cache.SetCache(cachekey, json, CacheConst.CACHE_CUSTOMER_DETAIL_JSON_TIME);
            }
            else
                json = _Cache.GetCache(cachekey).ToString();

            return json;
        }

                                                public static CustomerInfo Cache_Detail_Info(int id)
        {
            CustomerInfo info = null;
            string cachekey = CacheConst.CACHE_CUSTOMER_DETAIL_INFO + id.ToString();

            if (_Cache.GetCache(cachekey) == null || _Cache.GetCache(cachekey).ToString() == "")
            {
                info = ZLDC.Topo.BLL.Estate.CustomerBLL.p_customer_detail(id);
                _Cache.SetCache(cachekey, info, CacheConst.CACHE_CUSTOMER_DETAIL_INFO_TIME);
            }
            else
                info = (CustomerInfo)_Cache.GetCache(cachekey);

            return info;
        }

        #endregion
   
    }


}
